<%@ page language="java" contentType="text/html;charset=utf-8"
	pageEncoding="utf-8"%>
<%@ page import="com.sms.project.*"%>
<%@ page import="net.sf.json.*"%>
<%@ page import="com.sms.user.*"%>
<%@ page import="java.util.*"%>

<%--
	project/teacher/get-leader.jsp
 --%>

<%
	response.setContentType("text/html;charset=utf-8");
	request.setCharacterEncoding("utf-8");
	response.setCharacterEncoding("utf-8");
	String userno = session.getAttribute("userno").toString();

	List<Student> list = new ArrayList<Student>();
	list = User.getLeaderStudents(userno);
	if (list != null && list.size() > 0) {
		JSONArray json = new JSONArray();
		List jlist = new ArrayList();
		for (int i = 0; i < list.size(); i++) {
			Student s = (Student) list.get(i);
			String sname = s.getSname();
			JSONObject j = new JSONObject();
			j.put("sno", s.getSno());
			j.put("sname", sname);
			json.add(j);
		}
		out.println(json);
	} else {
		System.out.println("没有组长");
	}
%>